import { defineEventHandler, readBody } from 'h3';

export default defineEventHandler(async (event) => {
  const body = await readBody(event);
  const { applicationId, version, environment, region } = body;

  return {
    code: 0,
    data: {
      id: `deploy_${Date.now()}`,
      applicationId,
      version,
      environment,
      region,
      status: 'pending',
      createTime: new Date().toISOString(),
    },
    msg: '部署任务已创建',
  };
});
